package com.bicon.botu.mall.base.rpc;


import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.bicon.botu.core.base.common.Constants;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import com.bicon.botu.mall.base.common.ValidationUtil;
import com.bicon.botu.mall.base.dto.ProductDTO;
import com.bicon.botu.mall.base.entity.ExpressTemplate;
import com.bicon.botu.mall.base.entity.FreightTemplate;
import com.bicon.botu.mall.base.service.IFreightTemplateService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 快递单RPC
 *
 * @author liushujie
 * @date 2018/5/8 0008 下午 16:05
 */
@CrossOrigin
@RestController
@RequestMapping("/V3.0.0/rpc/express-template")
public class ExpressTemplateRpc extends BaseController {

    /**
     * 获取已启用的快递单模板
     * @return
     */
    @RequestMapping(value = "/enabled-list", method = RequestMethod.GET)
    public BaseResult enabled() {
        List<ExpressTemplate> expressTemplateList = new ExpressTemplate().selectList(new EntityWrapper<ExpressTemplate>().eq("logic_delete", Constants.DEL_LOGIC_NORMAL).
                eq("status", 1).orderBy("sort", false));
        return new BaseResult(Constants.RESPONSE_CODE_200, Constants.RESPONSE_MESSAGE_200, expressTemplateList);
    }
}
